import { createApp } from 'vue'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'
import router from './router'
import './styles/index.scss'
import { useSystemStore } from './stores/system'

const app = createApp(App)
const pinia = createPinia()

app.use(pinia)
app.use(router)
app.use(ElementPlus)

// 初始化系统配置
const systemStore = useSystemStore(pinia)
await systemStore.fetchSystemConfig()
document.title = systemStore.systemConfig.systemName || '证书管理系统'

app.mount('#app')
